
---@class RedDotsExpeditionHandler
RedDotsExpeditionHandler ={};
local this = RedDotsExpeditionHandler;

function RedDotsExpeditionHandler.init()

    CloseEvent(Config.EventType.ExpeditionDataRefresh,this.update);
    ListenEvent(Config.EventType.ExpeditionDataRefresh,this.update);
    CloseEvent(Config.EventType.Refresh_UnlockModule,this.UnlockModule)
    ListenEvent(Config.EventType.Refresh_UnlockModule,this.UnlockModule);
    return this;
end

--
function RedDotsExpeditionHandler.getFlag(...)
    if logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.expedition,false) then
        if logicMgr.ExpeditionMgr.HasRedPoint() then
            return Config.RedDotsFlagState.Needful
        end
    end
    return Config.RedDotsFlagState.None;
end


function RedDotsExpeditionHandler.update()
    this.CheckReward()
end

function RedDotsExpeditionHandler.CheckReward()
    RedDotsManager.addBroadcast(Config.RedDotsType.Expedition);
end
function RedDotsExpeditionHandler.UnlockModule(id)
    if id == Config.FuncOpenType.expedition then
        logicMgr.ExpeditionMgr.SetRedPoint(true)
        this.update()
    end
end